package com.example.dingtalkwebproject.controller;

import com.example.dingtalkwebproject.pojo.vo.bfInfo;
import com.example.dingtalkwebproject.service.bfInfoService;
import com.example.dingtalkwebproject.utils.AjaxResult;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/create")
public class createBillIdController {

    @Autowired
    private bfInfoService bfInfoService;

    // 获取单号
    @GetMapping("/getBfBillId")
    public AjaxResult getBfBillId() {
        // 点击之后获取残次单号
        bfInfo bfInfo = bfInfoService.selectbfInfo();
        if (ObjectUtils.isEmpty(bfInfo)) {
            return AjaxResult.error("未获取到门店残次报废的单号!");
        }
        return AjaxResult.success(bfInfo);
    }
}
